﻿using DPS.Prototype.Extension;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using DPS.Prototype.Model;
using DPS.Prototype.PolicyBase;
using DPS.Prototype.Policy;
using System.Collections.Generic;

namespace DPSTesting
{
    
    
    /// <summary>
    ///This is a test class for ObjectExtensionDataControllerTest and is intended
    ///to contain all ObjectExtensionDataControllerTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ObjectExtensionDataControllerTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Inspect
        ///</summary>
        [TestMethod()]
        public void InspectTest()
        {
            ProdLine line1=new DPS.Prototype.Model.ProdLine("AHEH", "A212", "A2", null);
            ProdLine line2=new DPS.Prototype.Model.ProdLine("AHEH", "A213", "A2", null);
            ProdLine line3=new DPS.Prototype.Model.ProdLine("AHEH", "A214", "A2", null);

            SubmitResult r1 = new DPS.Prototype.Model.SubmitResult() { FinishTime = DateTime.Now, ProdLine =line1, StartTime = DateTime.Now, ProduceQty = 1000.00f, WorkOrder = new DPS.Prototype.Model.WorkOrder() { OrderNo = "WO0001" } };
            SubmitResult r2 = new DPS.Prototype.Model.SubmitResult() { FinishTime = DateTime.Now, ProdLine =line2, StartTime = DateTime.Now, ProduceQty = 1000.00f, WorkOrder = new DPS.Prototype.Model.WorkOrder() { OrderNo = "WO0002" } };
            SubmitResult r3 = new DPS.Prototype.Model.SubmitResult() { FinishTime = DateTime.Now, ProdLine = line3, StartTime = DateTime.Now, ProduceQty = 1000.00f, WorkOrder = new DPS.Prototype.Model.WorkOrder() { OrderNo = "WO0003" } };

            Submission m1 = new Submission(r1, new DefaultProdCompetitor(line1), 0);
            Submission m2 = new Submission(r2, new DefaultProdCompetitor(line2), 0);
            Submission m3 = new Submission(r3, new DefaultProdCompetitor(line2), 0);

            
            object[] arr = { m1,m2,m3};

            List<object> list = new List<object>();
            list.Add(m1);
            list.Add(m2);
            list.Add(m3);


            string actual;
            actual = ObjectExtension.Inspect(arr);
            Console.WriteLine(actual);


            string actual1;
            actual1 = ObjectExtension.Inspect(arr);
            Console.WriteLine(actual1);

        }

        /// <summary>
        ///A test for Inspect
        ///</summary>
        [TestMethod()]
        public void InspectTest1()
        {
            ProdLine line1 = new DPS.Prototype.Model.ProdLine("AHEH", "A212", "A2", null);
            ProdLine line2 = new DPS.Prototype.Model.ProdLine("AHEH", "A213", "A2", null);
            ProdLine line3 = new DPS.Prototype.Model.ProdLine("AHEH", "A214", "A2", null);

            SubmitResult r1 = new DPS.Prototype.Model.SubmitResult() { FinishTime = DateTime.Now, ProdLine = line1, StartTime = DateTime.Now, ProduceQty = 1000.00f, WorkOrder = new DPS.Prototype.Model.WorkOrder() { OrderNo = "WO0001" } };
            SubmitResult r2 = new DPS.Prototype.Model.SubmitResult() { FinishTime = DateTime.Now, ProdLine = line2, StartTime = DateTime.Now, ProduceQty = 1000.00f, WorkOrder = new DPS.Prototype.Model.WorkOrder() { OrderNo = "WO0002" } };
            SubmitResult r3 = new DPS.Prototype.Model.SubmitResult() { FinishTime = DateTime.Now, ProdLine = line3, StartTime = DateTime.Now, ProduceQty = 1000.00f, WorkOrder = new DPS.Prototype.Model.WorkOrder() { OrderNo = "WO0003" } };

            Submission m1 = new Submission(r1, new DefaultProdCompetitor(line1), 0);
            Submission m2 = new Submission(r2, new DefaultProdCompetitor(line2), 0);
            Submission m3 = new Submission(r3, new DefaultProdCompetitor(line2), 0);

            
            object[] arr = { m1, m2, m3 };

            List<object> list = new List<object>();
            list.Add(m1);
            list.Add(m2);
            list.Add(m3);


            string actual;
            actual = ObjectExtension.Inspect(arr);
            Console.WriteLine(actual);


            string actual1;
            actual1 = ObjectExtension.Inspect(arr);
            Console.WriteLine(actual1);

        }
    }
}
